package org.dtrd.config.wechat.entity.bean.officialaccount.template;

import lombok.Data;
import org.dtrd.config.wechat.entity.bean.officialaccount.WechatOaTemplateMsg;

/**
 * @author xiao
 * @date 2022/5/31 3:44 PM
 */
@Data
public class OrderStateMsg extends WechatOaTemplateMsg {

    /**
     * 订单标题
     */
    private String orderTitle;

    /**
     * 订单金额 xx元
     */
    private String orderSum;

    /**
     * 订单编号
     */
    private String orderNo;


    public static final class OrderStateMsgBuilder {

        private OrderStateMsg orderStateMsg;

        private OrderStateMsgBuilder() {
            orderStateMsg = new OrderStateMsg();
        }

        public static OrderStateMsgBuilder getInstance() {
            return new OrderStateMsgBuilder();
        }

        public OrderStateMsgBuilder buildOrderPsySuccessMsg(String msgTitle, String orderTitle, String orderNo,String orderSum, String msgTime, String url, String remark) {
            this.withMsgTitle(msgTitle).withOrderTitle(orderTitle)
                    .withOrderSum(orderSum)
                    .withOrderNo(orderNo)
                    .withMsgTime(msgTime)
                    .withRemark(remark).withUrl(url);
            return this;
        }

        public OrderStateMsgBuilder withMsgTitle(String msgTitle) {
            orderStateMsg.setMsgTitle(msgTitle);
            return this;
        }

        public OrderStateMsgBuilder withUrl(String url) {
            orderStateMsg.setUrl(url);
            return this;
        }

        public OrderStateMsgBuilder withRemark(String remark) {
            orderStateMsg.setRemark(remark);
            return this;
        }

        public OrderStateMsgBuilder withMsgTime(String msgTime) {
            orderStateMsg.setMsgTime(msgTime);
            return this;
        }

        public OrderStateMsgBuilder withReceiverOpenIdArray(String[] receiverOpenIdArray) {
            orderStateMsg.setReceiverOpenIdArray(receiverOpenIdArray);
            return this;
        }

        public OrderStateMsgBuilder withOrderTitle(String orderTitle) {
            orderStateMsg.setOrderTitle(orderTitle);
            return this;
        }
        public OrderStateMsgBuilder withOrderNo(String orderNo) {
            orderStateMsg.setOrderNo(orderNo);
            return this;
        }

        public OrderStateMsgBuilder withOrderSum(String orderSum) {
            orderStateMsg.setOrderSum(orderSum);
            return this;
        }

        public OrderStateMsg build() {
            return orderStateMsg;
        }
    }
}
